var ul = $("ul");
var x = 0;
var speed;
var li_w = $("ul li").outerWidth(true);
ul.append(ul.html());
var li_size = $("ul li").length;
var a = li_size * li_w * 0.5;
ul.css("width",a*2);
var div = $(".div2");
var tick;
$(document).ready(function () {
    speed = -2;
    auto();
})
div.hover(function () {
    clearInterval(tick);
}, function () {
    speed = -2;
    auto();
});
function auto() {
    tick = setInterval(function () {
        if (x <= -a) {
            x = 0;
        }
        ul.css({"left": x += speed});
    }, 30);
}
;